<?php
namespace app\common\validate;

use think\Validate;

class Brand extends Validate
{
    protected $rule = [
        'member_id' => 'require|gt:0',
        'bank_id' => 'require|gt:0',
        'proposer' => 'require',
        'bank_card' => 'require',
        'mobile' =>  ['require', 'regex' => '/^1[3|4|5|7|8][0-9]\d{8}$/i']
    ];

    protected $message = [
        'member_id.require' => '用户ID异常',
        'member_id.gt' => '用户ID异常',
        'bank_id.require' => '请选择银行',
        'bank_id.gt' => '请选择银行',
        'proposer.require' => '请输入真实姓名',
        'bank_card.require' => '请输入银行卡号',
        'mobile.require' => '请填写收货人手机号码',
        'mobile.regex' => '手机号码格式错误',
    ];

    protected $scene = [
        'demand'  =>  ['member_id', 'drink_time', 'address', 'msg', 'consignee', 'mobile', 'lat', 'lng', 'consignment_type'],
    ];
}